package array;

import framework.AbstractTest;
import utils.Log;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by shane on 2018/8/22.
 */
public class ArrayOp extends AbstractTest implements Serializable, Cloneable {

    private static final String TAG = ArrayOp.class.getName();
    private static final long serialVersionUID = 4345295815829037360L;

    String name;

    @Override
    public String toString() {
        return "name:" + name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void test(String[] args) {
        super.test(args);

        List<String> as = new ArrayList<>();
        as.add("1");
        as.add("2");
        as.add("3");
        as.add(1, "A");


        String[] ss = new String[as.size()];
        as.toArray(ss);

        try {
            Log.vn(ss);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected String getTag() {
        return TAG;
    }
}
